<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../tpl/head.jsp"%>
<link rel="stylesheet" href="statics/css/secondarytitle.css">
<link rel="stylesheet" href="statics/css/ExportBusiness/tpl/newupoffer.css">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="header">
            <img class="img " src="statics/images/titheader.svg">
            <span>外销新增</span>
        </div>
        <div class="layui-card-body">
            <form class="layui-form" action="" lay-filter="editor-form" id="editor-form">

<%--                start--%>
    <dl class="layui-row sk_row">
        <div>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>客户名称</text>
                </div>
                <div class="layui-col-xs8">
                    <div class="layui-input-block" style="margin-left: 0;width: 100%" id="customerSelect"></div>
                    <input type="hidden" id="customerName" name="customerName">
                    <input type="hidden" id="customerCode" name="customerCode">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    客户联系人
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="customerContactName" id="customerContactName" lay-filter="customerContactName">
                        <option value=""></option>
                    </select>
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    国家
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="countryCode" id="countryCode" lay-filter="countryCode">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="countryName" id="countryName">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>客户等级</text>
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="customerLevelName" id="customerLevelName" autocomplete="off" class="layui-input" lay-verify="required">
                    <input type="hidden" name="customerLevelCode" id="customerLevelCode">
                </div>
            </dd>
        </div>

        <div>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    签约日期
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="signingDate" id="signingDate" lay-verify="required|date" autocomplete="off" class="layui-input starttime" placeholder="年 - 月 - 日">

                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>合同编号</text>
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="billNo" id="billNo" lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    客户合同号
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="customerContactNo" autocomplete="off" class="layui-input">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    合同总额
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="totalContractAmount" id="totalContractAmount" autocomplete="off" readonly lay-verify="required|number" class="layui-input">
                </div>
            </dd>
        </div>

        <div>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>预收款类型</text>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="paymentTypeCode" id="paymentTypeCode" lay-filter="paymentTypeCode" lay-verify="required">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="paymentTypeName" id="paymentTypeName">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    预收款金额
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="advancePaymentAmount" id="advancePaymentAmount" value="0" autocomplete="off" lay-verify="required|number" class="layui-input">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>币种</text>
                </div>
                <div class="layui-col-xs8">

                    <select lay-search name="currencyCode" id="currencyCode" lay-filter="currencyCode" lay-verify="required">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="currency" id="currency">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    美元兑人民币汇率
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="rmbRate" id="rmbRate" autocomplete="off" class="layui-input" lay-verify="required">
                </div>
            </dd>
        </div>
        <div style="display: flex;clear: both">
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    客户账期
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="customerAccountingPeriod" readonly id="customerAccountingPeriod" value="0" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
            </dd>
            <dd class="layui-col-md3 Authority-Label">
                <div class="layui-col-xs4 text-right padding-right">
                    城市
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="city" id="city" autocomplete="off" class="layui-input">
                </div>
            </dd>
            <dd class="layui-col-md3 Authority-Label">
                <div class="layui-col-xs4 text-right padding-right">
                    银行信息
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="bankCode" id="bankCode" lay-filter="bankCode">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="bankName" id="bankName">
                </div>
            </dd>
            <dd class="layui-col-md3 Authority-Label">
                <div class="layui-col-xs4 text-right padding-right">
                    美元汇率
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="usdRate" id="usdRate" autocomplete="off" class="layui-input" lay-verify="required">
                </div>
            </dd>
        </div>

        <div>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>业务模式</text>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="businessModelCode" id="businessModelCode" lay-filter="businessModelCode" lay-verify="required">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="businessModelName" id="businessModelName">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>是否采购</text>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="whetherToPurchase" id="whetherToPurchase" lay-filter="whetherToPurchase" lay-verify="required">
                        <option value=""></option>
                        <option value="1" selected="selected">是</option>
                        <option value="0">否</option>
                    </select>
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>交货日期</text>
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="carryTime" id="carryTime" lay-verify="required|date" autocomplete="off" class="layui-input" placeholder="年 - 月 - 日">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>唛头</text>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="shippingMark" id="shippingMark" lay-verify="required">
                        <option value=""></option>&ndash;
                        <option value="1">是</option>&ndash;
                        <option value="0" selected="selected">否</option>&ndash;
                    </select>
                </div>
            </dd>
        </div>

        <div>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>价格术语</text>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="priceTermsCode" id="priceTermsCode" lay-filter="priceTermsCode" lay-verify="required">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="priceTermsName" id="priceTermsName">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>是否报关</text>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="isDeclare" id="isDeclare" lay-filter="isDeclare" lay-verify="required">
                        <option value=""></option>
                        <option value="1" selected="selected">是</option>
                        <option value="0">否</option>
                    </select>
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>运输方式</text>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="transportCode" id="transportCode" lay-filter="transportCode" lay-verify="required">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="modeOfTransport" id="modeOfTransport">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>货柜型号</text>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="containerTypeCode" id="containerTypeCode" lay-filter="containerTypeCode">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="containerType" id="containerType">
                </div>
            </dd>
        </div>

        <div>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    起运地
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="transitPlaceCode" id="transitPlaceCode" lay-filter="transitPlaceCode">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="transitPlaceName" id="transitPlaceName">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    目的地
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="destinationCode" id="destinationCode" lay-filter="destinationCode">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="destinationName" id="destinationName">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>是否打托</text>
                </div>
                <div class="layui-col-xs8"><select lay-search name="whetherToSupport" id="whetherToSupport" lay-verify="required">
                    <option value=""></option>
                    <option value="1" selected>是</option>
                    <option value="0">否</option>
                </select></div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>分批出运</text>
                </div>
                <div class="layui-col-xs8"><select lay-search name="shipmentInBatches" id="shipmentInBatches" lay-verify="required">
                    <option value=""></option>
                    <option value="1">是</option>
                    <option value="0" selected>否</option>
                </select></div>
            </dd>
        </div>

        <div>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    是否走信保订单
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="whetherCreditGuarantee" id="whetherCreditGuarantee" lay-filter="whetherCreditGuarantee">
                        <option value=""></option>
                        <option value="1">是（采购抬头：上海沣奇）</option>
                        <option value="2">是（采购抬头：上海源铢）</option>
                        <option value="0" selected="selected">否</option>
                    </select>
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    信保订单金额
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="creditGuaranteeAmount" id="creditGuaranteeAmount" value="0" autocomplete="off" lay-verify="number" class="layui-input">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    是否客诉补货
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="whetherToReplenish" id="whetherToReplenish" lay-filter="whetherToReplenish">
                        <option value=""></option>
                        <option value="1">是</option>
                        <option value="0" selected="selected">否</option>
                    </select>
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    CAPA号
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="customerComplaintNo" id="customerComplaintNo" autocomplete="off" class="layui-input">
                </div>
            </dd>
        </div>

        <div>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>瓶底是否指定Logo</text><%--贸易方式：改为 RTCO LOGO--%>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="modeOfTrade" id="modeOfTrade" lay-verify="required">
                        <option value="1" selected="selected">不指定</option>
                        <option value="2">指定光面</option>
                        <option value="3">指定客户Logo</option>
                        <option value="4">指定Rtco Logo</option>
                    </select>
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right"><%--单据备注改为：客户特殊要求--%>
                    客户特殊要求
                </div>
                <div class="layui-col-xs8">
                    <textarea name="memo" style="min-height: 4em;" placeholder="请输入内容" class="layui-textarea"></textarea>
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    <text>业务员</text>
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="salesmanCode" id="salesmanCode" lay-filter="salesmanCode" lay-verify="required">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="salesmanName" id="salesmanName">
                </div>
            </dd>
            <dd class="layui-col-md3">
                <div class="layui-col-xs4 text-right padding-right">
                    签约公司
                </div>
                <div class="layui-col-xs8">
                    <select lay-search name="signingCompanyCode" id="signingCompanyCode" lay-filter="signingCompanyCode" lay-verify="required">
                        <option value=""></option>
                    </select>
                    <input type="hidden" name="signingCompanyName" id="signingCompanyName">
                </div>
            </dd>
        </div>













       <%-- <dd class="layui-col-md3">
            <div class="layui-col-xs4 text-right padding-right">
                联系人邮箱
            </div>
            <div class="layui-col-xs8">
                <input type="text" name="contactEmail" id="contactEmail" autocomplete="off" class="layui-input">
            </div>
        </dd>
        <dd class="layui-col-md3">
            <div class="layui-col-xs4 text-right padding-right">
                银行信息
            </div>
            <div class="layui-col-xs8">
                <select lay-search name="bankCode" id="bankCode" lay-filter="bankCode">
                    <option value=""></option>
                </select>
                <input type="hidden" name="bankName" id="bankName">
            </div>
        </dd>
        <dd class="layui-col-md3">
            <div class="layui-col-xs4 text-right padding-right">
                <text>预计收款日期</text>
            </div>
            <div class="layui-col-xs8">
                <input type="text" name="paymentTerm" autocomplete="off" class="layui-input starttime" placeholder="年 - 月 - 日">
            </div>
        </dd>
        <dd class="layui-col-md3">
            <div class="layui-col-xs4 text-right padding-right">
                <text>充值占用</text>
            </div>
            <div class="layui-col-xs8">
                <select lay-search name="rechargeOccupancy" id="rechargeOccupancy" lay-filter="rechargeOccupancy" lay-verify="required">
                    <option value=""></option>&ndash;
                    <option value="1">是</option>&ndash;
                    <option value="0" selected="selected">否</option>&ndash;
                </select>
            </div>
        </dd>
        <dd class="layui-col-md3">
            <div class="layui-col-xs4 text-right padding-right">
                预收款比例%
            </div>
            <div class="layui-col-xs8">
                <input type="text" name="advancePaymentRatio" id="advancePaymentRatio" value="0" autocomplete="off" lay-verify="required|number" class="layui-input">
            </div>
        </dd>
        <dd class="layui-col-md3">
            <div class="layui-col-xs4 text-right padding-right">
                信用额度
            </div>
            <div class="layui-col-xs8">
                <input type="text" name="creditQuota" id="creditQuota" readonly="readonly" value="0" autocomplete="off" class="layui-input">
            </div>
        </dd>
        <dd class="layui-col-md3">
            <div class="layui-col-xs4 text-right padding-right">
                美元汇率
            </div>
            <div class="layui-col-xs8">
                <input type="text" name="usdRate" id="usdRate" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </dd>--%>
    </dl>
<%--                over--%>

                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-tab layui-tab-card">
                            <ul class="layui-tab-title">
                                <li class="layui-this">产品</li>
                                <li class="">费用</li>
                                <li class="">附件</li>
                                <li class="">日志</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div  class="layui-tab-item  layui-show">
                                    <table class="layui-table" id="storageproducts" lay-filter="storageproductstable"></table>

                                    <div class="layui-tab layui-tab-card" id="hidden">
                                        <ul class="layui-tab-title">
                                            <li class="layui-this">产品规格配件</li>
                                            <li class="">库存现状</li>
                                        </ul>
                                        <div class="layui-tab-content">
                                            <div class="layui-tab-item layui-show">
                                                <table class="layui-table" id="productsaselect" lay-filter="productsatable"></table>
                                            </div>
                                            <div class="layui-tab-item">
                                                <table class="layui-table" id="istatusselect" lay-filter="istatustable"></table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-tab-item">
                                    <table class="layui-table" id="cost" lay-filter="costtable"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <table class="layui-table" id="attachment" lay-filter="attachmenttable"></table>
                                </div>
                                <div class="layui-tab-item"><table class="layui-table" id="otherwarehouselog" lay-filter="logtable"></table></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="padding text-right">
                    <button type="button" class="layui-btn" lay-submit="" lay-filter="form-element">立即提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="layui-upload" id="attachmentupload" style="display: none;padding: 10px">
    <a type="button" class="layui-btn layui-btn-normal" id="uploadfile">选择文件</a>
    <div class="layui-upload-list">
        <table class="layui-table">
            <thead>
            <tr><th>文件名</th>
                <th>大小</th>
                <th>状态</th>
                <th>操作</th>
            </tr></thead>
            <tbody id="uploadlist"></tbody>
        </table>
    </div>
    <a type="button" class="layui-btn" id="testListAction">开始上传</a>
</div>
<script type="text/html" id="imgTpl">
    <img src="{{d.img}}" data-id="{{d.tempId}}" class="btn_productimg" onerror="this.src='statics/images/layui-logo.jpg';this.onerror=null" alt="产品图片" style="max-width:70px;max-height: 28px;">
</script>

<script type="text/html" id="productcodeselect">
    <div class="layui-input-inline">
        <div class="layui-form-select ySearchSelect y_{{d.tempId}}" data-id="{{d.tempId}}">
            <div class="layui-input value_{{d.tempId}}">{{d.productCode==undefined?"":d.productCode}}</div>
            <i class="layui-edge"></i>
            <table class="layui-table zdy" id="productcodeselect_{{d.tempId}}" lay-filter="productcodeselecttable_{{d.tempId}}"></table>
        </div>
    </div>
</script>

<script type="text/html" id="customscodeselect">
    <select name="customsCode" class="customsCode" id="customsCode_{{d.tempId}}" lay-filter="customscodeselect_filter">
        <option value=""></option>
    </select>
</script>

<script type="text/html" id="unitselect">
    <select name="productUnitCode" class="productUnitCode" id="productUnitCode_{{d.tempId}}" lay-filter="unitselect_filter">
        <option value=""></option>
    </select>
</script>

<script type="text/html" id="costtypeselect">
    <select name="typeCode" class="typeCode" id="typeCode_{{d.tempId}}" lay-filter="costtypeselect_filter">
        <option value=""></option>
    </select>
</script>

<script type="text/html" id="costtoolbar">
    <a class="layui-btn layui-btn-normal" lay-event="new">增加费用</a>
    <a class="layui-btn layui-btn-danger" lay-event="del">删除</a>
    <span> 说明:（金额>0 为增加费用；金额<0 为扣减费用）</span>
</script>

<script type="text/html" id="storageproductstoolbar">
    <a class="layui-btn layui-btn-normal" lay-event="new">新增</a>
<%--    <a class="layui-btn" data-type="getCheckData" lay-event="newProductAndParts">产品合并</a>--%>
    <a class="layui-btn" data-type="getCheckData" lay-event="importquotation">导入报价单</a>
    <a class="layui-btn layui-btn-danger" lay-event="del">删除</a>
</script>
<script type="text/html" id="storageproductseditor">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<script type="text/html" id="attachmenttoolbar">
    <a class="layui-btn" data-type="getCheckData" lay-event="uploadfile">上传</a>
    <a class="layui-btn layui-btn-danger" lay-event="annexDel">删除</a>
</script>
<script type="text/html" id="attachmenteditor">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="download">下载</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<script type="text/html" id="productsaup">
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="productsade">删除</a>
</script>
<script type="text/html" id="productsatoolbar">
    <a class="layui-btn layui-btn-sm" data-type="getCheckData" lay-event="new">添加</a>
    <a class="layui-btn layui-btn-sm layui-btn-danger"  lay-event="delet">删除</a>
</script>
<script type="text/html" id="istatustoolbar">
    <a class="layui-btn layui-btn-sm" data-type="getCheckData" lay-event="refresh">刷新</a>
</script>
<%@ include file="../../tpl/foot.jsp"%>
<script src="statics/js/ExportBusiness/tpl/newupexport.js"></script>
<script src="statics/js/bignumber.js"></script>